import request from '@/utils/request';
import bodyParse from '@/utils/bodyParse';


//出借给-请求
export async function lendcompany(params) {
  return request('/wbn-api/voucher/lend_company', {
    method: 'PUT',
    data: params,
  });
}

//出借给-拒绝
export async function lendrefuse(params) {
  return request('/wbn-api/voucher/lend_refuse', {
    method: 'PUT',
    data: params,
  });
}

//出借给-同意
export async function lendagree(params) {
  return request('/wbn-api/voucher/lend_agree', {
    method: 'PUT',
    data: params,
  });
}



//交接给-请求
export async function handover(params) {
  return request('/wbn-api/voucher/hand_over', {
    method: 'PUT',
    data: params,
  });
}


//交接给-拒绝
export async function handoverrefuse(params) {
  return request('/wbn-api/voucher/hand_over_refuse', {
    method: 'PUT',
    data: params,
  });
}

//交接给-同意
export async function handoveragree(params) {
  return request('/wbn-api/voucher/hand_over_agree', {
    method: 'PUT',
    data: params,
  });
}

//归还
export async function giveback(params) {
  return request('/wbn-api/voucher/give_back', {
    method: 'PUT',
    data: params,
  });
}


//交接给-入库
export async function givebackagree(params) {
  return request('/wbn-api/voucher/give_back_agree', {
    method: 'PUT',
    data: params,
  });
}

//交接给-出库
export async function lendout(params) {
  return request('/wbn-api/voucher/lend_out', {
    method: 'PUT',
    data: params,
  });
}


//交接给-出库
export async function handoveroutstore(params) {
  return request('/wbn-api/voucher/hand_over_out_store', {
    method: 'PUT',
    data: params,
  });
}


//交接给-出库
export async function handovere(params) {
  return request('/wbn-api/resource/hand_over', {
    method: 'PUT',
    data: params,
  });
}
//交接给-出库
export async function confirmhandover(params) {
  return request('/wbn-api/resource/confirm_hand_over', {
    method: 'PUT',
    data: params,
  });
}

//创建资料原件
export async function addresource(params) {
  return request('/wbn-api/resource', {
    method: 'POST',
    data: params,
  });
}

//更新资料原件
export async function editresource(params) {
  return request('/wbn-api/resource/' + params.id, {
    method: 'PUT',
    data: params,
  });
}

//删除资料原件
export async function deleteresource(params) {
  return request('/wbn-api/resource/' + params, {
    method: 'DELETE',
  });
}

//创建资料原件
export async function addvoucher_storage(params) {
  return request('/wbn-api/voucher_storage', {
    method: 'POST',
    data: params,
  });
}

//更新资料原件
export async function editvoucher_storage(params) {
  return request('/wbn-api/voucher_storage/' + params.id, {
    method: 'PUT',
    data: params,
  });
}

//删除资料原件
export async function deletevoucher_storage(params) {
  return request('/wbn-api/voucher_storage/' + params, {
    method: 'DELETE',
  });
}


//创建
export async function addaccount_book(params) {
  return request('/wbn-api/account_book', {
    method: 'POST',
    data: params,
  });
}

//更新
export async function editaccount_book(params) {
  return request('/wbn-api/account_book/' + params.id, {
    method: 'PUT',
    data: params,
  });
}

//删除
export async function deleteaccount_book(params) {
  return request('/wbn-api/account_book/' + params, {
    method: 'DELETE',
  });
}


//创建凭证报送(暂存/提交)
export async function addvoucher(params) {
  return request('/wbn-api/voucher', {
    method: 'POST',
    data: params,
  });
}

//更新凭证报送信息（暂存时编辑/被拒绝)
export async function editvoucher(params) {
  return request('/wbn-api/voucher/' + params.id, {
    method: 'PUT',
    data: params,
  });
}

//删除凭证报送
export async function deletevoucher(params) {
  return request('/wbn-api/voucher/' + params, {
    method: 'DELETE',
  });
}

//拒绝
export async function refusevoucher(params) {
  return request('/wbn-api/voucher/voucher_refuse', {
    method: 'PUT',
    data: params,
  });
}

//拒绝
export async function reviewvoucher(params) {
  return request('/wbn-api/voucher/voucher_review', {
    method: 'PUT',
    data: params,
  });
}

//拒绝
export async function vouchercomplete(params) {
  return request('/wbn-api/voucher/voucher_complete', {
    method: 'PUT',
    data: params,
  });
}